package com.ruoyi.user.sms.feign;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.Map;

@FeignClient(contextId = "remoteRoleService", value = ServiceNameConstants.SYSTEM_SERVICE)
public interface RemoteRoleService {
    
    /**
     * 为用户分配角色
     * 
     * @param body 包含 userId 和 roleIds 的请求体
     * @param source 请求来源
     * @return 结果
     */
    @PostMapping("/user/authRole")
    R<Void> assignUserRole(@RequestBody Map<String, Object> body, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
